Method, intermediate device and computer program code for maintaining persistency

ABSTRACT

A method for maintaining server persistency, including: (a) receiving, by an intermediate entity, a first session request from client to receive a service from a server out of a plurality of servers that are connected to the intermediate entity; (b) selecting a server out of the plurality of servers and directing to the selected server information indicative of the first session request; (c) receiving a response of the selected server to the information indicative of the first session request; (d) analyzing the response of the selected server, to provide an analysis result indicative whether the response includes code to be executed by the client and includes at least one instruction that facilitates sending, by the client, another request, to receive a service from a server out of the plurality of servers; (e) modifying, based on the analysis result, the code by adding information that will cause the client to send a selected server identifier in association to the sending of the other request; and (f) sending a modified response to the client, wherein the modified response includes the modified code.

RELATED APPLICATIONS

The present application is a Continuation Patent Application of U.S.patent application Ser. No. 12/271,903, filed on Nov. 16, 2008, entitled“METHOD, INTERMEDIATE DEVICE AND COMPUTER PROGRAM CODE FOR MAINTAININGPERSISTENCY,” which is a Continuation Patent Application of U.S. patentapplication Ser. No. 11/692,942, filed on Mar. 29, 2007, entitled“METHOD, INTERMEDIATE DEVICE AND COMPUTER PROGRAM CODE FOR MAINTAININGPERSISTENCY,” which is a Non-Provisional Patent Application of U.S.Patent Provisional Application Ser. No. 60/888,195, filed on Feb. 5,2007, entitled “METHOD, INTERMEDIATE DEVICE AND COMPUTER PROGRAM CODEFOR MAINTAINING PERSISTENCY,” all of which are further incorporatedherein by reference in their entirety.

FIELD OF THE INVENTION

This application relates to dynamically changing browser code by anintermediate unit and especially relates to a method, an intermediatedevice and a computer program code for maintaining server persistency.

BACKGROUND OF THE INVENTION

Maintaining server persistency in web-based environment is a well knownrequirement for every web-based property that would like to maintainclients' sessions' context for environments with multiple identicalweb-servers, as the underline HTTP protocol is stateless by its nature.This mechanism is usually implemented by Application Delivery Controller(ADC) internal or external to the servers. One of the main duties of ADCis to balance the load between multiple, function-identical servers.With ADC, these servers look like a single high-powered computingresource that allows many clients to access it simultaneously, and thenbalances the load between these function-identical web-servers. Fewexisting load-balancing mechanisms are known in the art and will not bedescribed by this paper. When an ADC is configured to work withpersistency, it guarantees that client's consecutive requests whichbelong to the same session will follow the same destination server asthe first session request. The following main techniques are availabletoday for achieving this functionality: (i) maintaining sessionpersistency by source IP address, (ii) maintaining session persistencyby HTTP session cookie, (iii) Maintaining session persistency by addingsession identifier to URI part of the URL; and (IV) maintaining sessionpersistency using a URL identifier.

Maintaining session persistency by source IP address—in this case theADC looks for the source IP address of the client (the source IP addressappears in every TCP/IP packet that carries HTTP traffic) and forwardsall the requests which are coming from the same IP address to the samedestination web-server. This method is poorly working when many usersare accessing the same web-based application through Mega-Proxyserver(s) (e.g. AOL service provider users). Mega-Proxy/proxy serverreplaces the client source IP addresses with its own addresses pool,thus forcing the ADC to forward all the clients to the same web-server,thus creating unbalanced environment.

Maintaining session persistency by HTTP session cookie—cookie is awell-know mechanism for maintaining session states by the web-server.When a web-server sets a session cookie in a response to a clientrequest, the client is forced (by his/her browser software) to send thiscookie header for every consecutive request to the same domain/siteduring that session. An ADC which sits between the server and the clientcan trace/modify/add a dedicated cookie header on the server response,in-order to signal itself to which server to forward the next requestsfrom that particular client on the way back. Although this method iscommonly used, it doesn't solve the issue of persistency when cookiemechanism is disabled by the client. A description of this method can befound in U.S. Pat. No. 6,473,802 which is incorporated herein byreference.

Maintaining session persistency by adding a session identifier to URIpart of URL—when cookie isn't supported by the client, the web-server(by adjusting its code) can add session identifier to the URI part ofthe URL in every HTML response it sends. The ADC then traces the sessionidentifier on the server response and saves this information in itsinternal memory together with the identifier of the server from whichthe response has come. Upon receiving the next request from the client,the ADC matches the URL identifier with those which are stored in itsmemory and forwards the request to the designated server which appearsin its memory. This method will only work when the server code isadjusted to add URL identifier for every URL in the HTML response, andit significantly increases the processing overhead of the web-server.The method of maintaining session persistency without client supportedcookie is described by U.S. Pat. No. 7,296,076 of Portolani which isincorporated herein by reference.

Maintaining session persistency using a URL identifier—this method is acombination of methods 2 and 3 above, whether or not the client supportscookie, the persistency is achieved by adding server identifier to everyURL in the HTML server response. On the first client's request the ADCselects one server out of plurality of servers according to itsload-balancing algorithm, and then later adds this server identifier toall the URLs which appear on the server's HTML response. The next comingrequests from this particular client will include the server identifier,as part of the URL, to which the request should be forwarded to; the ADCthen deletes this identifier, to prevent unexpected server behavior, andforwards the request according to the deleted server identifier value.An example of how to maintain persistency using URL identifier can befound in US patent application publication serial number 2003/0163586 ofSchnetzler.

Method 4 above, does not address the issue of persistency in modernweb-based environments where server's responses include browser codeprogram, such as Java Script, Flash, Silvertight, AJAX, etc. Thesebrowser codes hide the URLs that will be sent by the client's browserprogram in a non-standard way, e.g. every browser code programmer canselect his/her own way of writing the code, making the response URLmodification task impossible.

SUMMARY THE INNOVATION

The present invention provides methods and intermediate devices asdescribed in the accompanying claims. Specific embodiments of theinvention are set forth in the dependent claims. These and other aspectsof the invention will be apparent from and elucidated with reference tothe embodiments described hereinafter.

The present invention provides methods and intermediate devices asdescribed in the accompanying claims. Specific embodiments of theinvention are set forth in the dependent claims. These and other aspectsof the invention will be apparent from and elucidated with reference tothe embodiments described hereinafter.

A method for maintaining server persistency, the method includes:receiving, by an intermediate entity, a first session request fromclient to receive a service from a server out of a plurality of serversthat are coupled to the intermediate entity; selecting a server out ofthe plurality of servers and directing to the selected serverinformation indicative of the first session request; receiving aresponse of the selected server to the information indicative of thefirst session request; analyzing the response of the selected server, toprovide an analysis result indicative whether the response comprisescode to be executed by the client and comprises at least one instructionthat facilitates sending, by the client, another request to receive aservice from a server out of the plurality of servers of the same site(plurality of servers that reside on the same site); modifying, inresponse to the analysis result, the code by adding information thatwill cause the client to send a selected server identifier inassociation to the sending of the other request; and sending a modifiedresponse to the client, wherein the modified response comprises themodified code.

The method can include analyzing the response of the selected server tolocate browser code to be executed by a browser of the client.

The method can include analyzing the response of the selected server tolocate at least one instruction that is executed by a browser of theclient and includes a call to an entity to enable sending the otherrequest, wherein the entity is selected from a group consisting of anoperating system of the client and an API layer between the browser codeand the operating system of the client.

The method can include adding an HTTP header for each call instructionof the code, wherein each HTTP header includes the selected serveridentifier, if the other request and the modified response areassociated with a same site.

The method can include receiving, by the intermediate node, the otherrequest from the client; removing the selected server identifier toprovide a modified other request; and sending to the selected serverinformation indicative of the modified other request.

The method can include receiving a selected server response thatincludes compressed code; de-compressing the compressed code to providede-compressed code; wherein the analyzing includes analyzing thede-compressed code; wherein the modifying includes modifying, inresponse to the analysis result, the de-compressed code by addinginformation that will cause the client to send a selected serveridentifier in association to the sending of the other request;compressing the modified de-compressed code to provide a compressedmodified code; and sending a modified response to the client, whereinthe modified response includes the compressed modified code.

The method can include receiving a selected server response thatincludes encrypted code; decrypting the encrypted code to decryptedcode; wherein the analyzing includes analyzing the decrypted code;wherein the modifying includes modifying, in response to the analysisresult, the decrypted code by adding information that will cause theclient to send a selected server identifier in association to thesending of the other request; encrypting the modified decrypted code toprovide an encrypted modified code; and sending a modified response tothe client, wherein the modified response includes the encryptedmodified code.

The method can include modifying, in response to the analysis result,the code by adding information that will cause the client to send aselected server identifier in association to the sending of the otherrequest if the other request and the modified response are associatedwith a same site.

An intermediate device, including: a client interface configured toreceive a first session request from client to receive a service from aserver out of a plurality of servers; a server selector configured toselect a server out of the plurality of servers; a server interface,coupled to the plurality of servers and configured to direct to theselected server information indicative of the first session request andto receive a response of the selected server to the informationindicative of the first session request; an analyzer configured toanalyze the response of the selected server, to provide an analysisresult indicative whether the response includes code to be executed bythe client and includes at least one instruction that facilitatessending, by the client, another request to receive a service from aserver out of the plurality of servers; a modifier configured to modify,in response to the analysis result, the code by adding information thatwill cause the client to send a selected server identifier inassociation to the sending of the other request and wherein the clientinterface is further adapted to send a modified response to the client,wherein the modified response includes the modified code.

The analyzer is configured to analyze the response of the selectedserver to locate browser code to be executed by a browser of the client.

The analyzer is configured to analyze the response of the selectedserver to locate at least one instruction that is executed by a browserof the client and includes a call to an entity to enable sending theother request, wherein the entity is selected from a group consisting ofan operating system of the client and an API layer between the browsercode and the operating system of the client.

The modifier is configured to add an HTTP header for each callinstruction of the code, if the other request and the modified responseare associated with a same site, wherein each added HTTP header includesthe selected server identifier.

The client interface is configured to receive, by the intermediate node,the other request from the client; wherein the modifier is configured toremove the selected server identifier to provide a modified otherrequest; and the client interface is configured to send to the selectedserver information indicative of the modified other request.

The intermediate device can include a de-compressor and a compressor;wherein the server interface is configured to receive a selected serverresponse that includes compressed code; wherein the de-compressor isconfigured to de-compress the compressed code to provide decompressedcode; wherein the compressor is configured to compress decompressedmodified code received from the modifier to provide a compressedmodified code; and wherein the client interface is configured to send amodified response to the client, wherein the modified response includesthe compressed modified code.

The intermediate device can include a decryptor and a encryptor; whereinthe server interface is configured to receive a selected server responsethat includes encrypted code; wherein the decryptor is configured todecrypt the encrypted code to provide decrypted code; wherein theencryptor is configured to decrypt decrypted modified code received fromthe modifier to provide an encrypted modified code; and wherein theclient interface is configured to send a modified response to theclient, wherein the modified response includes the encrypted modifiedcode.

The intermediate device can include a modifier that is configured tomodify, in response to the analysis result, the code by addinginformation that will cause the client to send a selected serveridentifier in association to the sending of the other request if theother request and the modified response are associated with a same site.

A computer program product that includes a computer readablenon-transitory medium that stores instructions for: receiving, by anintermediate entity, a first session request from client to receive aservice from a server out of a plurality of servers that are coupled tothe intermediate entity; selecting a server out of the plurality ofservers and directing to the selected server information indicative ofthe first session request; receiving a response of the selected serverto the information indicative of the first session request; analyzingthe response of the selected server, to provide an analysis resultindicative whether the response includes code to be executed by theclient and includes at least one instruction that facilitates sending,by the client, another request to receive a service from a server out ofthe plurality of servers of the same site; modifying, in response to theanalysis result, the code by adding information that will cause theclient to send a selected server identifier in association to thesending of the other request and sending a modified response to theclient, wherein the modified response includes the modified code.

The computer program product can include a computer readable medium thatstores instructions for analyzing the response of the selected server tolocate browser code to be executed by a browser of the client.

The computer program product can include a computer readable medium thatstores instructions for analyzing the response of the selected server tolocate at least one instruction that is executed by a browser of theclient and includes a call to an operating system of the client toenable sending the other request.

The computer program product can include a computer readable medium thatstores instructions for adding an HTTP header for each call instructionof the code, if the other request and the modified response areassociated with a same site, wherein each HTTP header includes theselected server identifier.

The computer program product can include a computer readable medium thatstores instructions for: receiving, by the intermediate node, the otherrequest from the client; removing the selected server identifier toprovide a modified other request; and sending to the selected serverinformation indicative of the modified other request.

The computer program product can include a computer readable medium thatstores instructions for: receiving a selected server response thatincludes compressed code; de-compressing the compressed code to providede-compressed code; analyzing the de-compressed code; modifying, inresponse to the analysis result, the de-compressed code by addinginformation that will cause the client to send a selected serveridentifier in association to the sending of the other request;compressing the modified de-compressed code to provide a compressedmodified code: and sending a modified response to the client, whereinthe modified response includes the compressed modified code.

The computer program product can include a computer readable medium thatstores instructions for: receiving a selected server response thatincludes encrypted code; decrypting the encrypted code to decryptedcode; analyzing the decrypted code; modifying, in response to theanalysis result, the decrypted code by adding information that willcause the client to send a selected server identifier in association tothe sending of the other request; encrypting the modified decrypted codeto provide an encrypted modified code; and sending a modified responseto the client, wherein the modified response includes the encryptedmodified code.

The computer program product can include a computer readable medium thatstores instructions for modifying, in response to the analysis result,the code by adding information that will cause the client to send aselected server identifier in association to the sending of the otherrequest if the other request and the modified response are associatedwith a same site.

BRIEF DESCRIPTION OF THE DRAWINGS

Further details, aspects, and embodiments of the invention will bedescribed, by way of example only, with reference to the drawings.

FIG. 1 illustrates an intermediate entity such as application deliverycontroller, clients, network and multiple servers according to anembodiment of the invention;

FIG. 2 illustrates a method for maintaining server persistency,according to an embodiment of the invention.

FIG. 3 illustrates a method according to an embodiment of the invention;and

FIG. 4 illustrates a method according to an embodiment of the invention.

DETAILED DESCRIPTION OF THE DRAWINGS

Because the apparatus implementing the present invention is, for themost part, composed of electronic components and circuits known to thoseskilled in the art, circuit details will not be explained in any greaterextent than that considered necessary as illustrated above, for theunderstanding and appreciation of the underlying concepts of the presentinvention and in order not to obfuscate or distract from the teachingsof the present invention.

In the following specification, the invention will be described withreference to specific examples of embodiments of the invention. It will,however, be evident that various modifications and changes may be madetherein without departing from the broader spirit and scope of theinvention as set forth in the appended claims.

It has been shown that persistency can be maintained when a serverresponse includes client code. By modifying the code the client, whenexecuting the code, sends in association with a request to obtain aservice from a server, a server identifier that identifies the serverthat was selected to provide a response.

Conveniently, the method can be executed without using dedicated HTTPcookies.

According to an embodiment of the invention, on the first client request(to receive a service from a server) an intermediate entity (such as butnot limited to an application delivery controller—ADC) selects aselected server (for example—by applying a load balancing algorithm) towhich the request should be forwarded to. When the response of theselected server (selected server response) is received by theintermediate entity it analyzes the response to determine whether acertain code is included in the server response (The certain codeincludes one or more instructions that facilitate sending, by theclient, another request to receive a service from a server out of theplurality of servers of the same site). If the answer is negative theresponse is sent (conveniently without being modified) to the client. Ifthe analysis indicates that the selected server response includes thecertain code then the intermediate entity modifies that certain code byadding information that will cause the client to send a selected serveridentifier in association to the sending of the other request. Amodified response that includes the modified code is sent to the client.

FIG. 1 illustrates an intermediate device such as application deliverycontroller (ADC) 100, clients 10(1)-10(n), network 20, and multipleservers 30(1)-30(k), according to an embodiment of the invention.

ADC 100 is connected to multiple servers 30(1)-30(k) via serverinterface 120 and is connected via client interface 110 and network 20to clients 10(1)-10(n).

ADC 100 includes, in addition to server interface 120 and clientinterface 110, server selector 130, analyzer 140, modifier 150,decryptor 160, encryptor 170, de-compressor 180 and compressor 190. Itis noted that each of these modules can include hardware, software or acombination thereof. It is further noted that some modules (such asdecryptor 160, encryptor 170, de-compressor 180 and compressor 190) areoptional.

Client interface 110 receives a request from a client to receive aservice from a server out of servers 30(1)-30(k). After a connection wasestablished with a client, that client can send a first session request(which conveniently refers to the first session request of a clientsession) or additional session requests. A first session request afterthe establishment of the session requires an allocation of a server outof servers 30(1)-30(k) while other requests follow the allocation. Theother requests include a unique server identifier that is indicative ofa server (out of servers 30(1)-30(k) that was previously selected by ADC100. The client sends the unique server identifier inside the followingrequests based on the modified response code that was sent to it by ADC100.

The service requested by the client can involve sending information tothe client from the server, executing a program by the server, sendingto the client web pages, and the like.

In order to determine whether a received request is the first sessionrequest, client interface 110 sends it to analyzer 140.

Analyzer 140 that can determine whether a server was already assigned torespond to the client by searching the unique server identifier. If suchunique server identifier exists, ADC 100 sends the request to theselected server associated with the unique server identifier; otherwise,the request is sent to server selector 130.

Server selector 130 is configured to select a server out of plurality ofservers 30(1)-30(k). It can apply a load balancing algorithm, but thisis not necessarily so.

Once the selection of the selected server is made, server selector 130sends an indication to server interface 120 that directs informationindicative of the first session request to the selected server. Theinformation can be the first session request itself but this is notnecessarily so.

The selected server (out of servers 30(1)-30(k)) then sends to ADC 100 aselected server response (responsive to the information sent from ADC100) that is received by server interface 120.

The selected server response is sent to analyzer 140 that is configuredto analyze the response of the selected server and to provide ananalysis result. The analysis result indicates the selected serverresponse includes code to be executed by the client and includes atleast one instruction that facilitates sending, by the client, anotherrequest to receive a service from a server out of the plurality ofservers. If such a code is included in the selected server response thanthe code is sent to modifier 150.

Analyzer 140 can include an application parser engine that parses thecode as well as determines whether the code should de-compressed (byde-compressor 180) or decrypted (by decryptor 160) before being modifiedby modifier 150.

Modifier 150 is configured to modify the code, in response to theanalysis result, by adding information that will cause the client tosend a selected server identifier in association to the sending of theother request. According to an embodiment of the invention, modifier 150is configured to modify, in response to the analysis result, the code byadding information that will cause the client to send the selectedserver identifier in association to the sending of the other request ifit is destined to the same site from which the modified response hasbeen received. Modifier 150 can include a browser code engine that canamend the code to include information that will cause the client to senda selected server identifier in association to the sending of the otherrequest. The information can include one or more instructions, one ofmore data fields (such as a HTTP header) and the like. Modifier caninclude a browser code engine that can add a HTTP ServerID header to thebrowser code, whenever the browser code sends request to a web site thatcan be serviced by the selected browser.

Modifier 150 can, for example, parse the browser code and mark all thelocations where the browser should call the client's operating system(or an API layer between the browser code and the operating system ofthe client) for sending HTTP requests. In these locations modifier 150adds a unique HTTP header for each of these calls that will be sent tothe client with the next requests and includes a selected serveridentifier that will signal to ADC 100 which is the selected server.According to an embodiment of the invention, the modifier adds the HTTPheader if the request is destined to the same site from which themodified response has been received.

It is noted that, conveniently, the modification of the code is onlyapplied to the cases where the browser code sends request to the sitewhere the ADC is installed. When the code sends requests to other sitesthe code modification is conveniently not applied.

Modifier 150 outputs a modified response that is sent by clientinterface 110 to the client.

Modifier 150 can be configured to modify the code, in response to theanalysis result, by adding information that will cause the client tosend a selected server identifier in association to the sending of theother request if the other request and the modified response areassociated with the same site (or group of associated addresses). Forexample—if the other request is destined to the site from which themodified response has been received.

According to various embodiments of the invention ADC 100 also includesdecryptor 160, encryptor 170, de-compressor 180 and compressor 190.

Decryptor 160 can decrypt an encrypted selected server response or atleast an encrypted code within the selected server response to provide adecrypted code. The decrypted code can then be sent to analyzer 140and/or to modifier 150. Encryptor 170 can encrypt a modified response orat least a modified code. The encrypted modified code can then be sent(within a modified response) to the client.

Decryptor 160 and encryptor 170 can be included within an SSL Engine,but this is not necessarily so.

De-compressor 180 can de-compress a compressed selected server responseor at least a compressed code within the selected server response toprovide a de-compressed code. The de-compressed code can then be sent toanalyzer 140 and/or to modifier 150. Compressor 190 can compress amodified response or at least a modified code. The compressed modifiedcode can then be sent (within a modified response) to the client.

It is noted that ADC 100 can apply both compression and encryption ofcode. For example, it can decrypt and de-compress code and send it tomodifier 150 (or analyzer 140) and then compress and encrypt themodified code.

ADC 100 can include additional modules such as communication modules(including but not limited to a L2 switching module, an L3 routingmodule, a TCP termination engine) responsive to managing thecommunication between clients and servers.

According to various embodiments of the invention ADC 100 can also applyat least one prior art method for managing requested server requeststhat do not include code. It can, for example, maintain sessionpersistency by using a URL identifier.

FIG. 2 illustrates method 200 for maintaining server persistency,according to an embodiment of the invention.

Method 200 starts by stage 210 of receiving, by an intermediate entity,from a client a request to receive a service from a server out of aplurality of servers. The intermediate entity is connected between oneor more clients and one or more servers.

Stage 210 is followed by stage 240 of determining whether to select aserver out of the multiple servers or not. Stage 240 includesdetermining whether the request includes a server identifier thatidentifies one of the multiple servers. If such an identifier existsthen information representing the request is sent to that server. Thiscan occur if the request is not the first session request from theclient after a session with the client was established—where a selectionof a selected server has already occurred.

If the answer is positive—a server identifier exists—then stage 240 isfollowed by stage 260 of sending information representative of therequest to the selected server. Stage 260 can also include removing theserver identifier before sending the information to the selected server.

If the answer is negative—a server identifier does not exist—then stage240 is followed by stage 250 of selecting a server out of the pluralityof servers. Stage 250 is followed by stage 260 of sending to theselected server information indicative of the request.

Stage 260 is followed by stage 270 of receiving, by the intermediateentity, a selected server response—a response of the selected server tothe information indicative of the request.

Stage 270 is followed by stage 280 of analyzing the response of theselected server, to provide an analysis result indicative whether theresponse includes code to be executed by the client and whether the codeincludes at least one instruction that facilitates sending, by theclient, another request to receive a service from a server out of theplurality of servers. If the answer to both questions is positive thenstage 280 is followed by stage 290. Else, stage 280 is followed by stage300 of sending a response to the client.

Stage 280 of analyzing can include locating browser code to be executedby a browser of the client and especially (but not solely) locating atleast one instruction that is executed by a browser of the client andincludes a call to an operating system of the client to enable sendingthe other request. The call can be in the form of a send instruction.According to an embodiment of the invention, the call is a call to anentity to enable sending the other request, wherein the entity isselected from a group consisting of an operating system of the clientand an API layer between the browser code and the operating system ofthe client.

Stage 290 includes modifying the code by adding information that willcause the client to send a selected server identifier in association tothe sending of the other request. It is noted that according to anembodiment of the invention, the modifying is carried out if the otherrequest is destined to the site from which the modified response hasbeen received.

Stage 290 can include adding an HTTP header for each call instruction ofthe code, wherein each HTTP header comprises the selected serveridentifier. According to an embodiment of the invention, the adding ofthe HTTP header is carried out if the other request is destined to thesame site from which the modified response has been received.

It should be noted that conveniently, the modification of the code isonly applied to the cases where the browser code sends request to thesite where the ADC is installed. When the code sends requests to othersites, the code modification is conveniently not applied.

Stage 290 is followed by stage 310 of sending a modified response to theclient, wherein the modified response includes the modified code.

If the request sent by the client is the first session request toreceive a service then it is processed by the following stages: (i)receiving, by an intermediate entity, a first session request fromclient to receive a service from a server out of a plurality of serversthat are coupled to the intermediate entity; (ii) selecting a server outof the plurality of servers and directing to the selected serverinformation indicative of the first session request; (iii) receiving aresponse of the selected server to the information indicative of thefirst session request; (iv) analyzing the response of the selectedserver, to provide an analysis result indicative whether the responsecomprises code to be executed by the client and comprises at least oneinstruction that facilitates sending, by the client, another request toreceive a service from a server out of the plurality of servers; (v)modifying, based on the analysis result (if such a code exists), thecode by adding information that will cause the client to send a selectedserver identifier in association to the sending of the other request;and (vi) sending a modified response to the client, wherein the modifiedresponse comprises the modified code.

According to an embodiment of the invention stage 300 can be preceded bystage 292 of modifying URLs included in the selected server response inorder to identify the selected server. The modification can include, forexample, adding a unique server identifier to the URI of the URL of anHTML response sent to the client. It is noted that in this case theresponse can include a session identifier (instead of the unique serveridentifier) that can be mapped, by the intermediate entity to a selectedserver. In this case the session identifier can be modified.

It should be noted that, according to an embodiment of the invention, inrelation to responses which are not a browser code, a wrapper takesevery response which isn't a browser code and add to it a wrapper thatimplement the above, i.e. for every consecutive request that is sent tothe server the browser code wrapper adds an HTTP header with ServerID.

FIG. 3 illustrates method 400 according to an embodiment of theinvention.

Method 400 differs from method 200 by including stages 410, 420 and 430.

Stage 410 is preceded by stage 210 and is followed by stage 240. Stage410 includes decoding an encrypted request of the client. Stage 410 canalso include decrypting the entire request or a portion thereof.

Stage 420 is preceded by stage 270 and is followed by stage 280. Itincludes decrypting an encrypted code to provide a decrypted code. Theencrypted code is included in a selected server response and stage 420can include decrypting the selected server response or a portionthereof.

Stage 430 is preceded by stage 290 and is followed by stage 310. Itincludes encrypting a decrypted code to provide an encrypted code. Stage430 can also include encrypting the selected server response or aportion thereof. Stage 430 may also be preceded by stage 292 andfollowed by stage 300.

Applying method 400 can involve: (i) receiving a selected serverresponse that includes encrypted code; (ii) decrypting the encryptedcode to provide a decrypted code. In this caste the stage of analyzingincludes analyzing the decrypted code and the stage of modifyingincludes modifying, in response to the analysis result, the decryptedcode by adding information that will cause the client to send a selectedserver identifier in association to the sending of the other request;(iii) encrypting the modified decrypted code to provide an encryptedmodified code: and (iv) sending a modified response to the client,wherein the modified response comprises the encrypted modified code.

FIG. 4 illustrates method 500 according to an embodiment of theinvention.

Method 500 differs from method 200 by including stages 510, 520 and 530.

Stage 510 is preceded by stage 210 and is followed by stage 240. Stage510 includes de-compressing a compressed request of the client. Stage510 can also include de-compressing the entire request or a portionthereof

Stage 520 is preceded by stage 270 and is followed by stage 280. Itincludes de-compressing a compressed code to provide a de-compressedcode. Stage 520 can also include de-compressing the selected serverresponse or a portion thereof.

Stage 530 is preceded by stage 290 and is followed by stage 310. Itincludes compressing a de-compressed code to provide a compressed code.Stage 530 can also include compressing the selected serverresponse/modified response or a portion thereof. Stage 530 may also bepreceded by stage 292 and followed by stage 300.

Method 500 can include: receiving a selected server response thatcomprises compressed code; de-compressing the compressed code to providede-compressed code; wherein the analyzing comprises analyzing thede-compressed code; wherein the modifying comprises modifying, based onthe analysis result, the de-compressed code by adding information thatwill cause the client to send a selected server identifier inassociation to the sending of the other request; compressing themodified de-compressed code to provide a compressed modified code; andsending a modified response to the client, wherein the modified responsecomprises the compressed modified code.

According to an embodiment of the invention, an example for modifyingjava-script based browser code is provided:

-   -   a. Before:        -   objHTTP=new ActiveXObject(‘Microsoft.XMLHTTP’);        -   objHTTP.open(‘POST’,“OtherPage.asp”,false);        -   objHTTP.setRequestHeader(‘Accept-Encoding’,‘gzip, deflate’);        -   objHTTP.send    -   b. After:        -   objHTTP=new ActiveXObject(‘Microsoft.XMLHTTP’);        -   objHTTP.open(‘POST’,“OtherPage.asp”,false);        -   objHTTP.setRequestHeader(‘Accept-Encoding’,‘gzip, deflate’);        -   objHTTP.setRequestHeader(‘X-Cres-Session-ID’,‘persist-server-3004’);        -   objHTTP.send

According to another embodiment of the invention any of the mentionedabove methods, intermediate devices and computer program products can beaimed by a purpose that differs from maintaining a server's persistency.For example they can be applied for improving a user experience.

Conveniently, a combination of either one of the mentioned above methodscan be provided. For example, decryption can be applied on clientrequests or on selected server responses, de-compression operations canbe applied on selected server responses and code.

Because the apparatus implementing the present invention is, for themost part, composed of electronic components and circuits known to thoseskilled in the art, circuit details will not be explained in any greaterextent than that considered necessary as illustrated above, for theunderstanding and appreciation of the underlying concepts of the presentinvention and in order not to obfuscate or distract from the teachingsof the present invention.

We claim:
 1. A method for maintaining server persistency, comprising:receiving, by an intermediate entity, a first session request fromclient to receive a service from a server out of a plurality of serversthat are coupled to the intermediate entity; selecting a server out ofthe plurality of servers and directing to the selected serverinformation indicative of the first session request; receiving aresponse of the selected server to the information indicative of thefirst session request; analyzing the response of the selected server, toprovide an analysis result indicative whether the response comprisescode to be executed by the client and comprises at least one instructionthat facilitates sending, by the client, another request to receive aservice from a server out of the plurality of servers; modifying thecode by adding information that causes the client to send a selectedserver identifier in association to the sending of the other request,wherein the code is parsed and marked at each location where each callis made to the client, and wherein the information added at each markedlocation for each call includes a unique HTTP header that includes theselected server identifier independent of a dedicated HTTP cookie; andsending a modified response to the client, wherein the modified responsecomprises the modified code.
 2. The method according to claim 1 whereinthe method is executed without using dedicated HTTP cookies.
 3. Themethod according to claim 1 comprising analyzing the response of theselected server to locate at least one instruction that is executed by abrowser of the client and comprises a call to an entity to enablesending the other request, wherein the entity is selected from a groupconsisting of an operating system of the client and an API layer betweenthe code and the operating system of the client.
 4. The method accordingto claim 1, comprising adding the HTTP header for each call instructionof the code, wherein each HTTP header comprises the selected serveridentifier, if the other request and the modified response areassociated with a same site.
 5. The method according to claim 1comprising: receiving, by the intermediate node, the other request fromthe client; removing the selected server identifier to provide amodified other request; and sending to the selected server informationindicative of the modified other request.
 6. The method according toclaim 1 comprising: receiving a selected server response that comprisescompressed code; de-compressing the compressed code to providede-compressed code; wherein the analyzing comprises analyzing thede-compressed code; wherein the modifying comprises modifying, inresponse to the analysis result, the decompressed code by addinginformation that will cause the client to send the selected serveridentifier in association to the sending of the other request;compressing the modified de-compressed code to provide a compressedmodified code; and sending a modified response to the client, whereinthe modified response comprises the compressed modified code.
 7. Themethod according to claim 1 comprising: receiving a selected serverresponse that comprises encrypted code; decrypting the encrypted code todecrypted code; wherein the analyzing comprises analyzing the decryptedcode; wherein the modifying comprises modifying, in response to theanalysis result, the decrypted code by adding information that causesthe client to send the selected server identifier in association to thesending of the other request; encrypting the modified decrypted code toprovide an encrypted modified code; and sending a modified response tothe client, wherein the modified response comprises the encryptedmodified code.
 8. The method according to claim 1, comprising modifying,in response to the analysis result, the code by adding information thatwill cause the client to send the selected server identifier inassociation to the sending of the other request if the other request andthe modified response are associated with a same site.
 9. Anintermediate device, comprising: a memory that stores instructions; acircuit that executes the stored instructions to provide: a clientinterface that receives a first session request from a client to receivea service from a server out of a plurality of servers; a server selectorthat selects a server out of the plurality of servers; a serverinterface, coupled to the plurality of servers, and directs to theselected server information indicative of the first session request andreceives a response of the selected server to the information indicativeof the first session request; an analyzer that analyzes the response ofthe selected server, to provide an analysis result indicative whetherthe response comprises code to be executed by the client and comprisesat least one instruction that facilitates sending, by the client,another request to receive a service from a server out of the pluralityof servers; a modifier that modifies the code by adding information thatcauses the client to send a selected server identifier in association tothe sending of the other request, wherein the code is parsed and markedat each location where each call is made to the client, and wherein theinformation added at each marked location for each call includes aunique HTTP header that includes the selected server identifierindependent of a dedicated HTTP cookie; and wherein the client interfacesends a modified response to the client that includes the modified code.10. The intermediate device according to claim 9, wherein theintermediate device is unable to utilize dedicated HTTP cookies.
 11. Theintermediate device according to claim 9 wherein the analyzer analyzesthe response of the selected server to locate at least one instructionthat is executed by a browser of the client and comprises a call to anentity to enable sending the other request, wherein the entity isselected from a group consisting of an operating system of the clientand an API layer between the code and the operating system of theclient.
 12. The intermediate device according to claim 9 wherein themodifier adds the HTTP header for each call instruction of the code, ifthe other request and the modified response are associated with a samesite, wherein each added HTTP header comprises the selected serveridentifier.
 13. The intermediate device according to claim 9 wherein theclient interface receives, by the intermediate node, the other requestfrom the client; wherein the modifier is configured to remove theselected server identifier to provide a modified other request; and theclient interface is configured to send to the selected serverinformation indicative of the modified other request.
 14. Theintermediate device according to claim 9 comprising a decompressor and acompressor; wherein the server interface is receives a selected serverresponse that comprises compressed code; wherein the de-compressorde-compresses the compressed code to provide decompressed code; whereinthe compressor compresses decompressed modified code received from themodifier to provide a compressed modified code; and wherein the clientinterface sends a modified response to the client, wherein the modifiedresponse comprises the compressed modified code.
 15. The intermediatedevice according to claim 9 comprising a decryptor and an encryptor;wherein the server interface receives a selected server response thatcomprises encrypted code; wherein the decryptor decrypts the encryptedcode to provide decrypted code; wherein the encryptor encrypts decryptedmodified code received from the modifier to provide an encryptedmodified code; and wherein the client interface sends a modifiedresponse to the client, wherein the modified response comprises theencrypted modified code.
 16. The intermediate device according to claim9 wherein the modifier modifies, in response to the analysis result, thecode by adding information that causes the client to send the selectedserver identifier in association to the sending of the other requestwhen the other request and the modified response are associated with asame site.
 17. A non-transitory computer readable storage medium thatstores instructions for execution by a circuit, wherein execution of theinstructions performs actions, including: selecting a server out of theplurality of servers and directing to the selected server informationindicative of the first session request; receiving a response of theselected server to the information indicative of the first sessionrequest; analyzing the response of the selected server, to provide ananalysis result indicative whether the response comprises code to beexecuted by the client and comprises at least one instruction thatfacilitates sending, by the client, another request to receive a servicefrom a server out of the plurality of servers; modifying the code byadding information that causes the client to send a selected serveridentifier in association to the sending of the other request, whereinthe code is parsed and marked at each location where each call is madeto the client, and wherein the information added at each marked locationfor each call includes a unique HTTP header that includes the selectedserver identifier independent of a dedicated HTTP cookie; and sending amodified response to the client, wherein the modified response comprisesthe modified code.
 18. The medium of claim 17, further comprisinganalyzing the response of the selected server to locate at least oneinstruction that is executed by a browser of the client and comprises acall to an operating system of the client to enable sending the otherrequest.
 19. The medium of claim 17, further comprising adding the HTTPheader for each call instruction of the code, when the other request andthe modified response are associated with a same site, wherein each HTTPheader comprises the selected server identifier.
 20. The medium of claim17, further comprising modifying, in response to the analysis result,the code by adding information that causes the client to send theselected server identifier in association to the sending of the otherrequest when the other request and the modified response are associatedwith a same site.